/**
 * 函数
 **/
function showSubLevel(Obj)
{
	Obj.className="hover";
}
function hideSubLevel(Obj)
{
	Obj.className="";
}

/**
 * 程序入口
 **/
$(document).ready(function()
{
	/**
	* 企业查询
	*/
	new Marquee("company",0,1,430,138,52,0,0);
	new Marquee("caigou",0,1,430,138,52,0,0);
	
	/**
	* 企业查询
	*/
	$.initProv("#Ancillary_Index_Search_Company_Province","#Ancillary_Index_Search_Company_City");
	var company_button=$('#Ancillary_Index_Search_Company_Button');
	var company_province=$('#Ancillary_Index_Search_Company_Province');
	var company_city=$('#Ancillary_Index_Search_Company_City');
	var company_model=$('#Ancillary_Index_Search_Company_Model');
	var company_name=$('#Ancillary_Index_Search_Company_Name');
	company_button.click(function()
	{
		if(company_province.val()=='-1'&&company_city.val()=='-1'&&company_model.val()=='-1'&&company_name.val()=='')
		{
			company_province.focus();
			return false;		
		}		
		
		var location='/exec.php?action=ancillary_account_list&type=search';
		{
			if(company_province.val()!=''){
				location=location+'&province='+encodeURI(company_province.val());
			}	
			if(company_city.val()!=''){
				location=location+'&city='+encodeURI(company_city.val());
			}	
			if(company_model.val()!=''){
				location=location+'&model='+encodeURI(company_model.val());
			}
			if(company_name.val()!=''){
				location=location+'&name='+encodeURI(company_name.val());
			}			
		}	
		
		window.location=location;
		return false;
	});	
	
	/**
	* 产品查询
	*/
	$.initProv("#Ancillary_Index_Search_Supply_Province","#Ancillary_Index_Search_Supply_City");	
	var supply_button=$('#Ancillary_Index_Search_Supply_Button');	
	var supply_province=$('#Ancillary_Index_Search_Supply_Province');
	var supply_city=$('#Ancillary_Index_Search_Supply_City');
	var supply_year=$('#Ancillary_Index_Search_Supply_Year');
	var supply_title=$('#Ancillary_Index_Search_Supply_Title');

	supply_button.click(function()
	{		
		if(supply_province.val()=='-1'&&supply_city.val()=='-1'&&supply_year.val()=='-1'&&supply_title.val()=='')
		{
			supply_province.focus();
			return false;		
		}		
		var location='/exec.php?action=ancillary_supply_list&type=search';
		{
			if(supply_province.val()!=''){
				location=location+'&province='+encodeURI(supply_province.val());
			}	
			if(supply_city.val()!=''){
				location=location+'&city='+encodeURI(supply_city.val());
			}	
			if(supply_year.val()!=''){
				location=location+'&year='+encodeURI(supply_year.val());
			}
			if(supply_title.val()!=''){
				location=location+'&title='+encodeURI(supply_title.val());
			}			
		}
		window.location=location;
		return false;
	});	
});


